package com.bishe.demo.modules.hotel.hotelDetail.dao;


import com.bishe.demo.modules.hotel.hotelDetail.entity.DetailHotelImage;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface DetailHotelImageDao {
    @Insert("insert into hotel_detail_hotel_image values(null,#{detailId},#{hotelImageId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertDetailHotelImage(DetailHotelImage detailHotelImage);

    @Delete("delete from hotel_detail_hotel_image where detail_id=#{detailId}")
    void deleteDetailImageByDetailId(int detailId);

    @Delete("delete from hotel_detail_hotel_image where hotel_image_id=#{hotelImageId}")
    void deleteDetailImageByImageId(int hotelImageId);
}
